17. 电话号码的字母组合

https://leetcode.cn/problems/letter-combinations-of-a-phone-number/description/

class Solution {
    const char*ArrNum[10]={"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
public:
    void Combine(const string &digits,int i,
    vector<string> &ans,string combineStr)
    {
        if(i==digits.size())
        {
            ans.push_back(combineStr);
            return ;
        }

        int num=digits[i]-'0';
        string str=ArrNum[num];
        for(auto ch:str)
        {
            Combine(digits,i+1,ans,combineStr+ch);
        }
    }
    vector<string> letterCombinations(const string &digits) {
        vector<string> ans;
        
        if(digits.empty())
        {
            return ans;
        }
 
        Combine(digits,0,ans,"");
        return ans;
    }
};